<template>
    <h1 style="text-align: center;">用户信息展示</h1>

    <table class="table table-bordered" border="2">
        <tr>
            <td>登录名称</td>
            <td>{{ Show.UL_Name }}</td>
        </tr>

        <tr>
            <td>登录密码</td>
            <td> ****** </td>
        </tr>

        <tr>
            <td>用户类型</td>
            <td>{{ Show.UT_Name }}</td>
        </tr>

        <tr>
            <td>真实姓名</td>
            <td>{{ Show.U_Name }}</td>
        </tr>

        <tr>
            <td>联系方式</td>
            <td>{{ Show.U_Phone }}</td>
        </tr>

        <tr>
            <td>身份证号</td>
            <td>{{ Show.U_IdCard }}</td>
        </tr>

        <tr>
            <td>出生日期</td>
            <td>{{ Show.U_Date.substring(0,10) }}</td>
        </tr>

        <tr>
            <td>性别</td>
            <td>{{ Boolean(Show.U_Sex) ==true?'女':'男' }}</td>
        </tr>

        <tr>
            <td>年收益</td>
            <td>{{ Show.U_money }}</td>
        </tr>

    </table>


</template>

<script setup lang="ts">

import {ref,onMounted} from 'vue';
import axios from 'axios';
import {useUserStore} from '../../store/index.ts'

const Show = ref({
    UL_Name:'',
    UL_Pwd:'',
    UT_Name:'',
    U_Name:'',
    U_Phone:'',
    U_IdCard:'',
    U_Date:'',
    U_Sex:'',
    U_money:''
})

const userStore = useUserStore();

console.log(userStore.Uid);

onMounted(()=>{
    axios({
        method:'get',
        url:'http://localhost:56707/api/User/UserDataShow',
        params:{
            Uid:userStore.Uid
        }
    })
    .then(res=>{
        console.log(res.data);
        Show.value = res.data[0];
    })
    .catch(err=>{
        console.log(err);
    })
})

</script>
